#ifndef SORT_H
#define SORT_H

#include <opencv2/opencv.hpp>
#include <memory>
#include <vector>

#include "tracker_manager.h"
#include "kalman_tracker.h"
#include "nn_matching.h"
#include "deepsort/mot_drawer.h"
#include "utils.h"




template<typename T>
class TrackerManager;

class SORT {
public:
    explicit SORT();

    ~SORT();
    Result Init(int32_t& deviceId, aclrtContext& context, aclrtStream& stream, aclrtRunMode& runMode){return SUCCESS;}
    Result Set(uint32_t width, uint32_t height);
    Result Process(cv::Mat& ori_img, 
            std::vector<BBox>& detections, std::vector<BBox>& trackResults);

    void DrawTrajectories(cv::Mat& ori_img, std::vector<BBox>& trackResults, bool isDrawTrajectory);

    void DestroyResource(){}

private:

    class TrackData;

    std::vector<TrackData> data;

    std::shared_ptr<TrackerManager<TrackData>> manager;

    std::shared_ptr<MotDrawer> drawer;
};

#endif //SORT_H
